<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义复选框</title>
    <style>
        /* 
            伪类元素：他是一种脱离文档流的一种元素

            伪类选择器：和 id 选择器 类选择器，标签选择器一样的功能，可以来选择标签
         */
        input[type="checkbox"] + label::before{
            content: '';
            display: inline-block;
            width: 18px;
            height: 18px;
            line-height: 18px;
            text-align: center;
            background-color: #ccc;
            vertical-align: bottom;
            border-radius: 5px;
            transition: all .2s ease;
            margin-right: 10px;
        }
        input[type="checkbox"]:checked + label::before{
            content: '\2713';
            background-color: yellowgreen;
        }
        input[type="checkbox"]{
            position: absolute;
            clip: rect(0,0,0,0);
        }
        input[type="checkbox"]:disabled + label::before{
            content: '\2713';
            background-color: #ccc;
            color: #666;
        }
        /* div{
            font-size: 22px;
            height: 100px;
            border: 1px solid red;
            line-height: 100px;
        } */
    </style>
</head>
<body>
    <p>
        <label for="test">复选框</label>
        <span>
            <input type="checkbox" id="test">
            <label for="test"></label>
        </span>
    </p>
    <!-- <div>
        <span>span</span>
        <b>b</b>
        <div style="display: inline-block; height: 50px; vertical-align: middle;">Test</div>
    </div> -->
</body>
</html>
